home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1993 November
/
1993-11.d64
/
easy does it
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
142 lines
10 rem*easy does it*by hugh rountree*12/14/92*for c64 & promenade eprom device*
20 rem*enable promos v2.0 previously*lines 10-70 auto-delete when program runs*
30 rem*set w=1 in line 90 to disable sound tone*
40 printchr$(147);" auto-deleting lines 10-70":print
50 print"10":print"20":print"30":print"40":print"50":print"60":print"70"
60 print"f 2000,dfff,00:run";chr$(19);
70 fori=1to8:poke630+i,13:next:poke198,8:poke56,32:end
80 dimh(15),w(8,3),pm(8,3),ca(7),a$(4),d$(2),r$(7),x$(4):fori=1to4:readdv(i)
90 next:fori=1to8:reade$(i):foria=1to3:readw(i,ia),pm(i,ia):next:next:w=0
100 data4096,256,16,1,"07ff",42,70,0,0,40,71,"0fff",226,70,225,7,224,7
110 data"1fff",6,14,5,14,20,14,"3fff",6,14,5,14,0,0,"7fff",230,70,229,70,0,0
120 data"ffff",226,6,0,0,0,0,"1fff",0,0,0,0,48,70,"03ff",0,0,0,0,40,7
130 tg$(0)="off)":tg$(1)=" on)":ia=48:fori=0to15:h(i)=i+ia:ifi=9thenia=55
140 next:d$(1)="compare":d$(2)="transfer":r$(1)="low unerased byte"
150 r$(2)="high byte loaded":r$(3)="high byte saved":r$(4)="high byte read"
160 r$(5)="fail address":r$(6)=r$(5):r$(7)=r$(5)
170 a$(1)="start":a$(2)="end":a$(3)="compare":a$(4)="transfer"
180 c$(1)="erasure":c$(2)="disk load":c$(3)="disk save":c$(4)="read eprom"
190 c$(5)="write eprom":c$(6)="verify eprom":c$(7)="compare ram":s$=" "
200 k$(1)="passed":k$(2)="failed":dn%=8:dn=peek(186):ifdn>7thendn%=dn
210 printchr$(147)chr$(14)s$s$"[208]romenade"
220 print:prints$"[218]ero [211]ocket---------> [218]"
230 print:prints$"[198]ill [205]emory([218]ero)---> [198]"
240 print:prints$"[195]heck [197]prom/[197]rasure-> [197]"
250 print:prints$"[204]oad [196]isk [198]ile------> [204]"
260 print:prints$"[211]ave [196]isk [198]ile------> [211]"
270 print:prints$"[211]et [197]prom [208]arameter-> [208]"
280 print:prints$"[211]et [210]am [193]ddresses--->[193][196][196]"
290 print:prints$"[210]ead [197]prom----------> [210]"
300 print:prints$"[215]rite [197]prom---------> [215]"
310 print:prints$"[215]rite [197]prom/[214]erify-->[214][197][210]"
320 print:prints$"[214]erify [197]prom/[210]am----> [214]"
330 print:prints$" h[157][157][157]";:input c$
340 ifc$="z"thengosub540:gosub550
350 ifc$="f"thengosub540:gosub830:gosub560
360 ifc$="e"thengosub540:cm=1:gosub600:cm=0
370 ifc$="l"thengosub540:cm=2:gosub620:cm=0
380 ifc$="s"thengosub540:gosub1380:ifea<53248thencm=3:gosub650:cm=0
390 ifc$="p"thengosub540:gosub680
400 ifc$="add"thengosub540:gosub830
410 ifc$="r"thengosub540:cm=4:gosub890:cm=0
420 ifc$="w"thengosub540:cm=5:gosub900:cm=0
430 ifc$="ver"thengosub540:cm=1:gosub910:cm=0
440 ifc$="v"thengosub540:cm=6:gosub970:cm=0
450 ifc$="h"thengosub540:gosub980
460 ifc$="m"thengosub540:gosub1290
470 ifc$="i"thengosub540:gosub1300
480 ifc$="d"thengosub540:gosub1310
490 ifc$="a"thengosub540:gosub1320
500 ifc$="c"thengosub540:cm=7:gosub1350:cm=0
510 ifc$="t"thengosub540:gosub1370
520 ifc$="toggle"thengosub540:gosub1400
530 goto210
540 printchr$(147)chr$(142):return
550 z:return
560 by%=0:print" enter value for memory fill"
570 print" hex ($00-$ff) ";:inputb$:l=len(b$):ifl<>2thengoto560
580 h$="00"+b$:ha=0:gosub1040:ifha<0orha>255then560
590 by%=ha%:f ba%,ea%,by%:return
600 ifee%=0orcw%=0thengosub680
610 e es%,ee%,cw%:gosub1220:return
620 ifba%=0thengosub830
630 gosub1000:ifn$=""thenreturn
640 l n$,dn%,ba%:gosub1220:return
650 ifba%=0andea%=0thengosub830
660 gosub1000:ifn$=""thenreturn
670 s n$,dn%,ba%,ea%:gosub1220:return
680 print" enter program volts(12.5/21/25)":print" ";:inputv$
690 ifv$<>"12.5"andv$<>"21"andv$<>"25"thengoto680
700 pv=1:ifval(v$)>12.5thenpv=2:ifval(v$)>21thenpv=3
710 print:print" enter eprom type(2758/2716/2732/2764)"
720 print" (27128/27256/27512/68764/68766/68769)"
730 print" ";:inputp$:ifp$="68764"orp$="68769"thenp$="68766"
740 ok=1:ifp$<>"2758"andp$<>"2716"andp$<>"2732"andp$<>"2764"thenok=0
750 ifok=0andp$<>"27128"andp$<>"27256"andp$<>"27512"andp$<>"68766"thengoto710
760 bt=16:s=1:print" ";:l=len(p$):et=val(right$(p$,l-2)):ml=2:gosub1130
770 print:ifcw%=0orpm%=0thengosub1160:goto680
780 h$=e$(s):ea$(2)=h$:ha=0:gosub1040:ma=ha:ee%=ha%:a1=1:gosub790:es%=ha%:return
790 print" enter eprom "a$(a1)" address":e$=h$:ifa1=1thenla=0:e$="00"
800 print" ($"e$"-$";e$(s);") ";:inputea$(a1)
810 print:h$=right$("0000"+ea$(a1),4):ha=0:gosub1040:ifha<laorha>mathen790
820 return
830 a1=1:ca=8192:gosub840:ba=ha:ba%=ha%:a1=2:ca=ba:gosub840:ea=ha:ea%=ha%:return
840 print" enter ram "a$(a1)" hex address":x$=x$(1):ifa1<>2thenx$="2000"
850 print" $"x$"-$dfff) ";:inputx$(a1):print
860 l=len(x$(a1)):ifl<>4then840
870 h$=x$(a1):ha=0:gosub1040:ifha<caorha>57343then840
880 return
890 gosub930:r ba%,ea%,es%,cw%:gosub1220:return
900 gosub930:gosub960:return
910 gosub600:cm=5:ifck=2then1170
920 gosub930:gosub960:cm=6:gosub970:return
930 ifba%=0orea%=0thengosub830
940 ifcw%=0orpm%=0thengosub680
950 return
960 p ba%,ea%,es%,cw%,pm%:gosub1220:return
970 gosub930:v ba%,ea%,es%,cw%:gosub1220:return
980 prints$" command addendum":print:print" ( m / i / d / a / c / t )"
990 print:prints$" toggle (checksum "tg$(tg):goto1170
1000 n$="":print:print" enter filename"
1010 print" ";:inputn$:print:ifn$=""thenreturn
1020 ifn$=","orn$="?"orn$="*"orn$="@"orn$=";"orn$="."thengoto1000
1030 return
1040 l=len(h$):fori=lto1step-1:b=16:a=asc(mid$(h$,i,1)):ifa>47anda<58then1060
1050 fa=0:ifa<65ora>70thenfa=1:goto1070
1060 gosub1090
1070 nexti:iffathenfa=0:ha=-1:return
1080 gosub1120:return
1090 b=b-1:ifh(b)>athen1090
1100 gosub1110:return
1110 ha=ha+(b*dv(i)):return
1120 ha%=ha+65536*(ha>32767):return
1130 re=et-bt:bt=bt*ml:ifrethens=s+1:ifs>6thenml=1:bt=766:ifs>7thenbt=58
1140 ifrethengoto1130
1150 cw%=w(s,pv):pm%=pm(s,pv):gosub1040:ml=2:return
1160 prints$"selected eprom type and":prints$"pgm. voltage not valid."
1170 print:print" -press any key to continue-":print:ifwthen1200
1180 poke54296,15:poke54278,89:poke54276,33
1190 poke54273,34:poke54272,75:fori=1to100:next:poke54273,45:poke54272,90
1200 geta$:ifa$=""thenonw+1goto1190,1200
1210 poke54296,0:return
1220 ad=peek(166)+256*peek(167)
1230 ifpeek(165)=0thenck=1:ifcm>4then1260
1240 print:ifpeek(165)=255thenck=2
1250 ifcm>1orck=2thenprint" "ad"= address of "r$(cm)
1260 poke165,0:poke166,0:poke167,0:ifcm<>4thenprint" "c$(cm)" command "k$(ck)
1270 ifc$="ver"thenifcm=1orcm=5thenreturn
1280 goto1170
1290 gosub830:m ba%,ea%:print:goto1170
1300 gosub830:i ba%,ea%:print:goto1170
1310 gosub1330:d es%,ee%,cw%:goto1170
1320 gosub1330:a es%,ee%,cw%:goto1170
1330 print:ifcw%=0thengosub680
1340 a1=1:gosub790:es%=ha%:la=ha:a1=2:gosub790:ee%=ha%:return
1350 gosub830:ca=8192:la=57343:a1=3:gosub840:ct%=ha%
1360 c ba%,ea%,ct%:print:gosub1220:return
1370 gosub830:ca=8192:a1=4:gosub840:ct%=ha%:t ba%,ea%,ct%:print:return
1380 ifea>53247thenprint" -data save not allowed above $cfff-":print:gosub1170
1390 return
1400 tg=tg+1:tg%=128:iftg>1thentg=0:tg%=0
1410 poke157,tg%:gosub990:return